#include<bits/stdc++.h>
using namespace std;
int main(){
	ofstream log_file("log.txt");
	log_file << "abcdefghijklmnopqrstuvwxyz" << endl;
	
	streambuf* original_cout = cout.rdbuf();
	cout.rdbuf(log_file.rdbuf());
	cout << "123456" << endl;
	cout.rdbuf(original_cout);
	return 0;
}
